import request from '@utils/request';
import * as actionTypes from './actionType';
import { message } from 'antd';

//获取所有订单
export const getAllClientMenuRequest = (values) => {
    return (dispatch) => {
        request('POST', '/api/server/web/rest/department/getAllOrder', {
            cmd: 'getAllOrder',
            type: 'request',
            request: {
               ...values 
            }
        }).then(obj => {
            let res = obj.response;
            if (res.res) {
                let result = res.message;
                dispatch(getAllClientMenuUpdateReducer(result))
            } else {
                message.error('获取数据失败' + res.exception, 1);
            }
        }).catch(err => console.log(err));
    }
}
const getAllClientMenuUpdateReducer = (allClientOrder) => ({
    type: actionTypes.CLIENTORDER,
    allClientOrder
})
